<template>
  <div class="content">
    <div class="table-table">
      <BiTable
        :loading="loading"
        :data="tableData"
        size="medium"
        :column="tableColums"
        fixed="sticky"
        fixed-offset="50"
        pagination
        layout="total, prev, pager, next"
        :auto-scroll="false"
        :total="page_info.total"
        :page.sync="page_info.page"
        :limit.sync="page_info.page_size"
        @pagination="handlePageChange"
      >
      </BiTable>
    </div>
  </div>
</template>

<script>
import { collectRecord } from '@/api/userPage'
export default {
  props: ['rowInfo'],
  data() {
    return {
      formInline: {
        order_time: [],
        order_time_start: '',
        order_time_end: '',
        member_id: ''
      },
      loading: false,
      tableData: [],
      tableColums: [
        {
          label: '短剧名称',
          prop: 'playlet_title'
        },
        {
          label: '收藏时间',
          prop: 'create_time'
        }
      ],
      page_info: {
        page: 1,
        page_size: 20,
        total: 0
      }
    }
  },
  mounted() {
    this.clickSearch()
  },
  methods: {
    handlePageChange(page) {
      this.page_info.page = page.page
      this.clickSearch()
    },
    clickSearch(type) {
      const data = {
        member_id: this.rowInfo.member_id,
        ...this.page_info
      }
      collectRecord(data).then(res => {
        if (res.status_code === 1) {
          this.tableData = res.data.data
          this.page_info = res.data.page_info
          this.page_info.total = Number(res.data.page_info.total)
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>

</style>